package com.network.retrofit_rx.Api;



import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * @author QiQi
 * @date 2017/7/15
 */

public interface RetrofitApiInterface {
    @FormUrlEncoded
    @POST
    Observable<String> postData(@Url String url, @FieldMap Map<String, Object> params);

    //add shibo.zheng start
    @POST
    Observable<String> postBody(@Url String url, @Body RequestBody body);
    //add shibo.zheng end

    @GET
    Observable<String> getData(@Url String url, @QueryMap Map<String, Object> params);


    @FormUrlEncoded
    @POST
    Observable<Boolean> postDataForBoolean(@Url String url, @FieldMap Map<String, Object> params);

    @GET
    Observable<Boolean> getDataForBoolean(@Url String url, @QueryMap Map<String, Object> params);

    @FormUrlEncoded
    @POST
    Observable<String> postUrlForQuery(@Url String url, @QueryMap Map<String, Object> paramsn, @FieldMap Map<String, Object> body);

    @Multipart
    @POST
    Observable<String> uploadfile(@Url String url, @QueryMap Map<String, Object> params, @PartMap Map<String, RequestBody> body);

}
